package com.lc.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

import com.cnpc.framework.utils.DateUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;

/**
 * @Description
 * @Author  Nomaj
 * @Date 2022-08-02
 */

@Setter
@Getter
@ToString
@Entity
@Table ( name ="tag_change_record" )
public class TagChangeRecord  implements Serializable {

	private static final long serialVersionUID =  6988069184894487016L;

	@Id
	@GenericGenerator(name = "id", strategy = "uuid")
	@GeneratedValue(generator = "id")
	@Column(name = "id", length = 36)
	private String id;

   	@Column(name = "createtime" )
	private String createtime;

   	@Column(name = "updatetime" )
	private String updatetime;


	/**
	 * 变更分类 0信息变更 1职位变更
	 */
	@Column(name = "changeType" )
	private int changeType;


	/**
	 * 变更时间
	 */
	@Column(name = "changeTime" )
	private String changeTime;
	/**
	 * 0家庭成员 1教育情况 2职称 3职业资格 4入职前工作经历
	 *  10入职 11转正 12任免 13调动 14离职 15退休
	 */
   	@Column(name = "type" )
	private int type;

	/**
	 * 操作人id
	 */
   	@Column(name = "userid" )
	private String userid;

	/**
	 * 操作对象id
	 */
   	@Column(name = "itemid" )
	private String itemid;

	/**
	 * 操作对象名称
	 */
   	@Column(name = "itemname" )
	private String itemname;

	/**
	 * 操作后数据
	 */
   	@Column(name = "dataaf" )
	private String dataaf;

   	@Column(name = "remark" )
	private String remark;

	/**
	 * 驳回原因
	 */
	@Column(name = "reason" )
	private String reason;

	/**
	 * 0待审 1审核通过 -1驳回
	 */
   	@Column(name = "state" )
	private int state;

	@Column(name = "shUserId" )
	private String shUserId;


	@Column(name = "shUserName" )
	private String shUserName;

	@Column(name = "shTime" )
	private String shTime;


	/**
	 * 原部门id
	 */
	@Column(name = "fromDeptId" )
	private String fromDeptId;

	/**
	 * 原部门名称
	 */
	@Column(name = "fromDeptName" )
	private String fromDeptName;

	/**
	 * 原岗位
	 */
	@Column(name = "fromPost" )
	private String fromPost;


	/**
	 * 新部门id
	 */
	@Column(name = "toDeptId" )
	private String toDeptId;

	/**
	 * 新部门名称
	 */
	@Column(name = "toDeptName" )
	private String toDeptName;

	/**
	 * 新岗位
	 */
	@Column(name = "toPost" )
	private String toPost;


	/**
	 * 变更值
	 */
	@Column(name = "changeTo" )
	private String changeTo;


	public void setDefaultTime(){
		String dateTime = DateUtil.format(new Date(),DateUtil.YYYY_MM_DD_HH_MM_SS);
		createtime = dateTime;
		updatetime = dateTime;
	}

	public void setDefaultCreateTime(){
		String dateTime = DateUtil.format(new Date(),DateUtil.YYYY_MM_DD_HH_MM_SS);
		createtime = dateTime;
	}

	public void setDefaultUpdateTime(){
		String dateTime = DateUtil.format(new Date(),DateUtil.YYYY_MM_DD_HH_MM_SS);
		updatetime = dateTime;
	}
	public void setDefaultShTime(){
		String dateTime = DateUtil.format(new Date(),DateUtil.YYYY_MM_DD_HH_MM_SS);
		shTime = dateTime;
	}
}
